home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / datasheets and manuals / Hardware / WHT / scsi / dsr_sources_2_2001 / reservedce < prev    next >
Text File  |  2006-10-19  |  932b  |  39 lines

  1. *  Subroutine RESDCE - Reserve Directory Cache Entry
  2. *
  3. *  This routine goes through the directory name cache
  4. *  and looks for any unused entries.  If it finds one,
  5. *  it returns a pointer to that entry in the caller's
  6. *  R4.  If there are no unused entries, it will reuse
  7. *  the least recently used entry.
  8. *
  9.  
  10. RESDCE DATA FDDRWS
  11.        DATA RESD1
  12.  
  13. RESD1  SETO R3           R3 will store oldest age
  14.        LI   R4,DNCASH
  15. RESD2  MOV  @4(R4),R5    See if this entry is unused
  16.        JEQ  RESD4
  17.  
  18.        C    R3,@46(R4)   Check this entry's age
  19.        JL   RESD3
  20.        MOV  @46(R4),R3   Save new age
  21.        MOV  R4,R5        R5 points to oldest entry
  22.  
  23. RESD3  AI   R4,48
  24.        CI   R4,>5FFE-48
  25.        JL   RESD2
  26.  
  27.        MOV  R5,R4
  28. RESD4  INC  @>5FFE
  29.        MOV  @>5FFE,@46(R4)
  30.        MOV  R4,@8(R13)
  31.        CLR  *R4+
  32.        CLR  *R4+
  33.        LI   R5,'  '
  34.        LI   R3,40
  35. RESD5  MOV  R5,*R4+
  36.        DECT R3
  37.        JNE  RESD5
  38.        RTWP
  39.